Let's play with Pandas!
Simple Analysis of the Cantareira reservoir hydroclimatic data
- Import pandas, numpy and matplotlib.pyplot
- Create a dataframe from the file "DataCantareira.csv".
- Clean your file by droping the NaN
- What is the minimum daily accumulated rainfall? Does it seems a resonable observed value? Remove every events (row) with a negative rainfall from the dataframe.
hint: use boolean indexing
- When the cantareira reservoir experienced its lowest level?
Hint:
-
- Find the lowest value
- Perform boolean indexing and select the corresponding index
- Make a bar plot of the average annual precipitation.
- Create a new column with the value of the reservoir volume in m³. Knowing that the maximum capacity of the reservoir is approximatively 1000 billions of liter.
Hint:
- Conversion: volume (m³) = (volume (%)/100) * 10^9
- Create a function which return the volume in m^3.
- Use the apply method
- In average, which month of the year the reservoir have the highest volume. Similarly, which month of the year there is the highest accumulation of rainfall? (Is there a delay?)